﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="planlist.aspx.cs" Inherits="EZCRS.HCMS.Web.manage.hotel.planlist" %>

<%@ Register Src="../usercontrol/titlepage.ascx" TagName="titlepage" TagPrefix="uc2" %>
<%@ Register Assembly="Book38.Net.CustomControl" Namespace="Book38.Net.CustomControl"
    TagPrefix="cc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title></title>
    <link type="text/css" href="../../style/main.css" rel="Stylesheet" />

    <script src="../../Common/jquery-1.2.6.min.js"></script>

    <script src="../../Common/flexigrid/flexigrid.js"></script>

    <link rel="stylesheet" href="../../Common/flexigrid/flexigrid.css" type="text/css"
        media="screen" />
</head>
<body>

    <script type="text/javascript" charset="utf-8">

        $(document).ready(function() {

            $('#grid').flexigrid({
                //		        width: $(document).width() - 10,
                height: 350,
                //striped:false,		        
                url: '?action=get',
                dataType: 'json',
                colModel: [
                    { display: '<%= Resources.Site.LabCode %>', name: 'code', width: 100, sortable: false, align: 'center' },
                    { display: '<%= Resources.Site.LabName %>', name: 'name', width: 180, sortable: false, align: 'left' },
                    { display: '<%= Resources.Site.LabRemark %>', name: 'desc', width: 300, sortable: false, align: 'left' },
                    { display: '<%= Resources.Site.LabStatus %>', name: 'state', width: 60, sortable: false, align: 'left' }
                ],
                singleSelect: true,
                buttons: [
                    { name: '<%= Resources.Site.LabModify %>', bclass: "edit", onpress: doCommand },
                    { separator: true }
                ],
                showTableToggleBtn: true,
                rp: 15,
                usepager: true,
                useRp: true
            });

            $('#btnsearch').click(function() {

                var params = "";
                //get country value
                var roomtype;
                var objselect = document.getElementById("ddlRoomType");
                for (var i = 0; i < objselect.length; i++) {
                    if (objselect[i].selected == true) {
                        roomtype = objselect[i].value;
                        break;
                    }
                }

                var state = $('input[@name=state][@checked]').val();

                params = roomtype + "," + state;

                $('#grid').flexOptions({ query: params }).flexReload();

            });

        });


        function doCommand(com, grid) {

            if (com == '<%= Resources.Site.LabModify %>') {

                if ($('.trSelected', grid)[0] == null) return;

                var rowid = $('.trSelected', grid)[0].id.replace(/row/, "");

                //alert(rowid);
                if (rowid != '')
                    window.location = 'plan_edit.aspx?id=' + rowid;
            }
        } 
    </script>

    <form id="form1" runat="server">
    <uc2:titlepage ID="Titlepage1" runat="server" inittitle="<%$ Resources:Site, TitlePlan %>">
    </uc2:titlepage>
    <table cellpadding="0" cellspacing="0" class="main-table">
        <tr class="line-even">
            <td>
                &nbsp;
                <asp:Literal ID="Literal2" Text="<%$ Resources:Site, LabActive %>" runat="server"></asp:Literal>:<input
                    id="Radio1" type="radio" checked="checked" name="state" value="1" />
                <asp:Literal ID="Literal1" Text="<%$ Resources:Site, LabNoActive %>" runat="server"></asp:Literal>:<input
                    id="Radio2" name="state" type="radio" value="0" />
                <asp:Literal ID="Literal3" Text="<%$ Resources:Site, LabAll %>" runat="server"></asp:Literal>:<input
                    id="Radio3" name="state" type="radio" value="-1" />
                &nbsp;&nbsp;&nbsp;&nbsp;
                <asp:Literal ID="Literal4" Text="<%$ Resources:Site, LabRoomType %>" runat="server"></asp:Literal>:
                <asp:DropDownList ID="ddlRoomType" runat="server">
                </asp:DropDownList>
                &nbsp;<input id="btnsearch" type="button" value="<%= Resources.Site.LabSearch %>"
                    class="bttn" />
            </td>
        </tr>

    </table>
    </form>
    <br/>
    <table id="grid">
    </table>
</body>
</html>
